package org.quipu.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import org.quipu.client.events.AppEventBus;

/**
 * Entry point classes define
 * <code>onModuleLoad()</code>.
 */
public class MainEntryPoint implements EntryPoint {

    /**
     * The message displayed to the user when the server cannot be reached or returns an error.
     */
    private static final String SERVER_ERROR = "An error occurred while "
            + "attempting to contact the server. Please check your network "
            + "connection and try again.";
    private MainWindow mainWindow;

    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {
        AppEventBus eventBus = new AppEventBus();
        mainWindow = new MainWindow(eventBus, new AppCache(eventBus));
        mainWindow.init();
        RootPanel.get().add(mainWindow.getWidget());
        RootPanel.get().setWidth("100%");
//        RootLayoutPanel.get().add(mainWindow.getWidget());
    }
}
